#ifndef Trie_hpp
#define Trie_hpp

#include <list>
#include <vector>
#include <ostream>
#include <istream>
#include <string>

class Trie {
	static char wordBuffer[1024];
	bool						 values;
	std::vector<Trie *>          children;
	int 						 qtyChildren;
public:
	Trie();
	virtual ~Trie();
	void insert(std::string word);
	bool retrieve(std::string word);
	bool retrieveUntil(std::string& word);
	void serialize(std::ostream& stream, int head = 0);
	int  deserialize(std::istream& stream);
	void remove(std::string word);

	template <typename T>
	void itemize(T& container, std::string path = std::string());
	
	static int convertToIndice(char letter);
	static char convertToChar(int pos);
};

#include <Trie.inl>

#endif
